<layout name="layout" />

<!-- 搜索 -->
<div class="form-div search_form_div">
    <form action="__ACTION__" method="GET" name="search_form">
		<p>
			分类名称：
	   		<input type="text" name="cat_name" size="30" value="<?php echo I('get.cat_name'); ?>" />
		</p>
		<p>
			上级分类id,0:顶级分类：
	   		<input type="text" name="parent_id" size="30" value="<?php echo I('get.parent_id'); ?>" />
		</p>
		<p><input type="submit" value=" 搜索 " class="button" /></p>
    </form>
</div>
<!-- 列表 -->
<div class="list-div" id="listDiv">
	<table cellpadding="3" cellspacing="1" class="table table-hover">
		<thead>
    	<tr class="success">
            <th style="text-align: left">分类名称</th>
			<th width="25%">操作</th>
        </tr>
		</thead>
		<tbody>
		<?php foreach ($data as $k => $v): ?>
			<tr class="tron">
				<td style="text-align: left"><?php echo str_repeat('-',8*$v['level']).$v['cat_name']; ?></td>
		        <td align="center">
		        	<a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" title="编辑">编辑</a> |
	                <a href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p')); ?>" onclick="return confirm('确定要删除吗？');" title="移除">移除</a> 
		        </td>
	        </tr>
        <?php endforeach; ?>
		</tbody>
	</table>
</div>
<nav style="text-align: center">
	<ul class="pagination">
		{$page}
	</ul>
</nav>

<link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="__PUBLIC__/bootstrap/js/bootstrap.min.js"></script>

<script src="__PUBLIC__/Admin/Js/tron.js"></script>